package fun.diaoer.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import fun.diaoer.service.PageService;
import lombok.extern.slf4j.Slf4j;

@Slf4j
@Controller
@RequestMapping("/page")
public class PageController {
	
	@Autowired
	private PageService pageService;
	
	
	@RequestMapping("/")
	public String goDefaultPage() {
		return "index";
	}
	
	@RequestMapping("/index.html")
	public String goPage() {
		return "index";
	}
	
	@RequestMapping("/login.html")
	public String loginPage() {
		return "login";
	}
	
	@RequestMapping("/{path}/{pageName}.html")
	public void loginPage(@PathVariable("path")String path,@PathVariable("pageName")String pageName) {
		log.info(path,pageName);
		pageService.getOuterPage(path,pageName);
	}
	
}
